<!DOCTYPE HTML>
<title>SVGDescElement interface</title>
<link rel="author" title="Timothy Gu" href="mailto:timothygu99@gmail.com">
<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#InterfaceSVGDescElement">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<svg id="svg">
  <desc id="desc">
    Hello <em id="em">world</em>
  </defs>
</svg>

<script>
"use strict";

test(() => {
  const svg = document.getElementById("svg");
  const desc = document.getElementById("desc");
  const em = document.getElementById("em");
  assert_true(desc instanceof SVGDescElement);
  assert_false(desc instanceof SVGGraphicsElement);
  assert_equals(desc.ownerSVGElement, svg);
  assert_equals(desc.viewportElement, svg);

  assert_true(em instanceof HTMLElement);
  assert_equals(em.namespaceURI, "http://www.w3.org/1999/xhtml");
}, "Basic properties");

test(() => {
  const desc = document.createElementNS("http://www.w3.org/2000/svg", "desc");
  assert_true(desc instanceof SVGDescElement);
  assert_false(desc instanceof SVGGraphicsElement);
  assert_equals(desc.ownerSVGElement, null);
  assert_equals(desc.viewportElement, null);
}, "Detached");

</script>
